<?php

namespace Test\Controller;
use Think\Page;


/**
 * Created by PhpStorm.
 * User: thinklev
 * Date: 2017/2/14
 * Time: 9:45
 */


class IndexController extends \think\Controller
{
    public function index()
    {
        //$this->display("index");
        $info=D('Test/Test')->getInfoById(1);
        $this->data=$info;
        $this->display();
    }

    public function test()
    {
        $info=D('Bigmall/Goods/Goods','Service')->getAddGoodsParam();
        $this->data=$info;
        $this->display();
    }

    public function add()
    {
        $user=D('Common/UcenterMember');
        $data['id']='444';
        $data['mobile']='11111113333';
        $user->add($data);
        $this->display();
    }

    public function ons()
    {
        $info =D('Test/Test/Test','Service');
        $this->info=$info->getNickNameById(1);
        $this->display();
    }

    public function get()
    {
        $tel=I("post.tel",'0');
        $this->tel=$tel;
        S("TEL",$tel);
        $this->display();
    }

    public function verify()
    {
        $Verify = new \Think\Verify();
        $Verify->entry();
    }

    public function form()
    {
        $this->display();
        $this->success('a','Test/gold');

    }

    public function gold()
    {
        $goldNum=D('Common/Gold')->getUserGoldNumber(313);
        $this->goldNums=$goldNum;
        $this->display();
    }

    public function game(){

        $this->display();
    }

    public function menu(){
            $menu=D('Test/Test/Test','Service');
            $this->menuList=$menu->getMenu();
            $this->display();
    }

    public function login()
    {
        $info=D('Common/UcenterMember');
        $count=$info->where(1)->count();//总记录数
        $page=new Page($count,10);
        $list=$info->field('id,mobile')->where(1)->order('id')->limit($page->firstRow.','.$page->listRows)->select();

        $show=$page->show();
        $this->assign('list',$list);
        $this->assign('page',$show);
        $this->display();
    }

    public function getExt($name){
        $pos=strrpos($name,'.');
        return substr($name,$pos);
    }

    public function _empty(){

    }



}